//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#if _MSC_VER > 1000
#pragma once
#endif

#if !defined(__CJFFS2FILESYSTEM_H__)
#define __CJFFS2FILESYSTEM_H__

#include "_CJffs2FileSystem.h"
#include "nodelist.h"
#include "stub.h"

class CJffs2FileSystem : public _CJffs2FileSystem
{
public:
    CARAPI GetFileSystemStat(
                /* [out] */ MemoryBuf * pFsstat);

    CARAPI Sync();

    CARAPI GetRoot(
                /* [out] */ IBasicDirectory * * piRoot);

    CARAPI Lookup(
                /* [in] */ WString pathname,
                /* [out] */ IBasicFile * * piBasicFile);

    CARAPI CalcFreeSpace(
                /* [out] */ UInt64 * pTotalNumberOfBytes,
                /* [out] */ UInt64 * pTotalNumberOfFreeBytes);

    CARAPI Mount(
                /* [in] */ WString type,
                /* [in] */ WString dir,
                /* [in] */ WString vDevName,
                /* [in] */ UInt32 flags);

    CARAPI Unmount(
                /* [in] */ WString dir,
                /* [in] */ UInt32 flags);

    CARAPI BindDriver(
                /* [in] */ WString wstrDevName);

    CARAPI UnbindDriver();

    CJffs2FileSystem();
    ~CJffs2FileSystem();
    IStub *GetStub();
    void SetStub(IStub *pStub);

private:
    // TODO: Add your private member variables here
    IBasicDirectory *m_pRootIBasicDirector;
    //class CFatFile *m_pRootCFatFile;
    class FileSystem *m_pFileSystem;
    IStub *m_pStub;
};

#endif //!(__CJFFS2FILESYSTEM_H__)
